package com.trainoo.utils;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

import com.trainoo.Interface.MyInterface;
import com.trainoo.Pojo.Pojo01;
import com.trainoo.Pojo.Pojo02_1;
import com.trainoo.Pojo.Pojo02_2;

public class CommonUtils {
	
	public static Pojo01 createPojo01(){
		Pojo01 pojo = new Pojo01();
		pojo.setAge(20);
		pojo.setName("pojo01");
		pojo.setPrice(12346);
		pojo.setListInterface(initList());
		
		return pojo;
	}
	
	private static List<MyInterface> initList(){
		List<MyInterface> list = new ArrayList<MyInterface>();
		
		Pojo02_1 p02_1 = new Pojo02_1();
		p02_1.setIntValue(10);
		p02_1.setStrValue("This is p02_1");
		
		Pojo02_2 p02_2 = new Pojo02_2();
		p02_2.setBigDeci(new BigDecimal(123456789));
		p02_2.setCharValue('C');
		
		list.add(p02_1);
		list.add(p02_2);
		
		return list;
	}
}
